import requests
from bs4 import BeautifulSoup


def getIp():
    resp = requests.get("https://2ip.ru")

    soup = BeautifulSoup(resp.content, "html.parser")

    my_ip = soup.find("div", class_="ip").find("span")

    return my_ip.text
